import Taro, { Component } from '@tarojs/taro'
import { View, Text} from '@tarojs/components'
import './cart.scss'

export default class Cart extends Component {

  constructor (props) {
    super(props)
    this.state = {
    }
  }
  componentWillMount () {}

  componentDidMount () {

  }

  componentWillUnmount () { }

  componentDidShow () {
    Taro.getSetting({
      success(res) {
        if (!res.authSetting['scope.userInfo']) {
          Taro.navigateTo({
            url: '/pages/auth/auth'
          })
        } else {
          console.log('用户信息已授权')

        }
      },
      fail: () => {
        console.log('getSetting 失败')
      }
    })
  }

  componentDidHide () { }

  render () {

    return (
      <View className='index'>
        <Text>购物车</Text>
      </View>
    )
  }
}

